London | 26-ITP-May | Remi M. | Sprint 3 | 2-practice-tdd#1326
London | 26-ITP-May | Remi M. | Sprint 3 | 2-practice-tdd#1326remimarcelle wants to merge 3 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
4 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
d7628a7 to
5e37cc1
Compare
There was a problem hiding this comment.
-
Could consider testing a few more samples in this script - higher chance to detect bugs in code.
-
The original specification did not clearly state whether the character match should be case-sensitive.
Most people would probably assume that it is, but to demonstrate our understanding or clarify the assumption we made, we could add test cases to convey this. For examples,- A case to show that the match is case sensitive
- A case to show that the function is expected to work also for non-alphabets
| * | ||
| * @param {string} stringOfCharacters - The string to search through. | ||
| * @param {string} findCharacter - The single character to count. | ||
| * @returns {number} The number of times findCharacter appears in stringOfCharacters. |
There was a problem hiding this comment.
Excellent documentation work here!
| // Case 5: All other numbers | ||
| // When the number does not end with 1, 2, or 3 (and is not an exception), | ||
| // Then the function should return a string by appending "th" to the number. | ||
| test("should append 'th' for all other numbers", () => { |
There was a problem hiding this comment.
When a test fails with the message "... all other numbers", it may be unclear what "other numbers" actually refers to.
Can you revise the test description to make it more informative?
There was a problem hiding this comment.
Have you tried running this script to ensure everything works as expected?
Learners, PR Template
Self checklist
Changelist
Completed implement and rewrite jest tests and practicing test driven development exercises and tests.